<?php

namespace Lib\Renderer;

use Twig_Loader_Filesystem;

class TwigFactory
{
    protected static $renderer;

    public static function factory()
    {
        if (self::$renderer === null) {
            $loader = new Twig_Loader_Filesystem('View/');
            self::$renderer = new TwigRenderer($loader, array('/tmp/twig/cache/'));
        }

        return self::$renderer;
    }
}